package online.takemehand.fx;

import javafx.application.Application;
import javafx.stage.Modality;
import javafx.stage.Stage;

/**
 * 模态
 * 最长用的两种 Modality.WINDOW_MODAL
 * 最长用的两种 Modality.APPLICATION_MODAL
 *
 */
public class Main3 extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        //模态化创就，弹窗不关闭，不能点后面窗口的内容
        Stage stage1 = new Stage();
        stage1.setTitle("stage 1");
        stage1.show();


        Stage stage2 = new Stage();
        stage2.setTitle("stage 2");
        //设置 stage1是stage2的拥有者
        stage2.initOwner(stage1);
        stage2.show();

        Stage stage3 = new Stage();
        stage3.initModality(Modality.WINDOW_MODAL);
        stage3.setTitle("stage 3");
        stage3.show();

    }
}
